{extend name="public:base"/}


{block name="title"}网站设置{/block}

{block name="style"}
<link href="__STATIC__/admin/plugin/my_uploader/css/uploads.css" rel="stylesheet">
{/block}

{block name="main"}

<section class="content" xmlns="http://www.w3.org/1999/html">
    <div class="row">

        <div class="col-md-12">

            <div class="row">
                <div class="col-lg-12">
                    <div class="box">
                        <div class="box-header with-border">
                            <h3 class="box-title">网站设置</h3>
                        </div>

                        <form  id="pt_form" action="<?=url('admin/System/handle')?>" method="post">
                            <input type="hidden" name="inc_type" value="<?=$inc_type?>">
                            <div class="box-body">

                                <div class="nav-tabs-custom">
                                    <ul class="nav nav-tabs">
                                        <?php foreach($group_list as $k=>$v){?>
                                        <li class="<?=$inc_type==$k?'active':''?>"><a href="<?=url('admin/System/index',['inc_type'=>$k])->suffix(false)?>"><?=$v?></a></li>
                                        <?php } ?>
                                    </ul>
                                </div>

                                <div class="clearfix"></div>

                                <div class="form-group required">
                                    <div class='col-sm-2 text-right'>
                                        <label for="title" class="control-label Validform_label" >网站标题</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="title" class="form-control" name="title" placeholder="请输入网站标题" datatype="s2-60" value="{$config.title}" errormsg="网站标题超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="logo" class="control-label Validform_label" >网站logo</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <div class="test">
                                            <div class="up-button" id="select-img">选择图片</div>
                                            <div class="img-list" id="img-list">
                                                <!--图片列表样例-->
                                                <div class="img-item">
                                                    <img src="/{$config.logo}">
                                                    <input type="hidden" name="logo" value="{$config.logo}"/>
                                                    <em class="delete" onclick="uploader.del_list(this)">×</em>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>


                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="logo" class="control-label Validform_label" >公众号二维码</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <div class="test">
                                            <div class="up-button" id="select-img2">选择图片</div>
                                            <div class="img-list" id="img-list2">
                                                <!--图片列表样例-->
                                                <div class="img-item">
                                                    <img src="/{$config.qrcode}">
                                                    <input type="hidden" name="qrcode"  value="{$config.qrcode}"/>
                                                    <em class="delete" onclick="uploader.del_list(this)">×</em>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>


                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="web_url" class="control-label Validform_label" >官方网址</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="web_url" class="form-control" name="web_url" placeholder="请输入官方网址" datatype="url" ignore="ignore" value="{$config.web_url}" errormsg="官方网址格式不正确">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="web_address" class="control-label Validform_label" >联系地址</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="web_address" class="form-control" name="web_address" placeholder="请输入联系地址"  value="{$config.web_address}" datatype="s1-100" errormsg="联系地址超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>


                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="web_desc" class="control-label Validform_label" >网站描述</label>
                                    </div>
                                    <div class='col-sm-10'>

                                        <textarea id="web_desc" class="form-control" name="web_desc" placeholder="请输入网站描述"   errormsg="网站描述超出长度范围">{$config.web_desc}</textarea>
                                        <div class="help-block"></div>
                                    </div>
                                </div>


                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="key_words" class="control-label Validform_label" >网站关键字</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="key_words" class="form-control" name="key_words" placeholder="请输入网站关键字" datatype="s1-100"  value="{$config.key_words}" errormsg="网站关键字超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>

                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="web_phone" class="control-label Validform_label" >网站电话</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="web_phone" class="form-control" name="web_phone" placeholder="请输入网站电话" datatype="*"  value="{$config.web_phone}" errormsg="网站电话超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>


                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="web_email" class="control-label Validform_label" >联系邮箱</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="web_email" class="form-control" name="web_email" placeholder="请输入邮箱" datatype="e"  value="{$config.web_email}" errormsg="邮箱格式不正确">
                                        <div class="help-block"></div>
                                    </div>
                                </div>


                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="web_qq" class="control-label Validform_label" >QQ</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="web_qq" class="form-control" name="web_qq" placeholder="请输入QQ" datatype="s1-100"   value="{$config.web_qq}" errormsg="QQ址超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>


                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="web_weixin" class="control-label Validform_label" >微信</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="web_weixin" class="form-control" name="web_weixin" placeholder="请输入微信"  value="{$config.web_weixin}" datatype="s1-100" errormsg="微信超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>


                                <div class="form-group ">
                                    <div class='col-sm-2 text-right'>
                                        <label for="web_icp" class="control-label Validform_label" >网站备案号</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="web_icp" class="form-control" name="web_icp" placeholder="请输入网站备案号" datatype="s1-100"  value="{$config.web_icp}" errormsg="网站备案号超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>

                            </div>
                            <div class="box-footer text-center">
                                <button class="btn btn-primary" type="submit">保存</button>
                                <span class="btn btn-white" onclick="history.go(-1)">返回</span>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
{/block}

{block name="js"}
<script src="__STATIC__/admin/plugin/my_uploader/js/uploads.js"></script>
<script>

    /*
    var validate = validator('#pt_form');

    validate.config({
        ajaxPost:false,
    });
    */
    $("#pt_form").Validform({
        tiptype: function(msg,o,cssctl){
            if(o.type == 3){
                toastr.error(msg);
                return false;
            }
        },
    });


    $('#select-img').click(function(){
        uploader.open({
            elm:'select-img',//选择图片上传的按钮
            url:"<?=url('common/AjaxController/uploader',['path'=>'site_config'])?>",//服务器url
            up_type:1,//上传图片类型1:单图,2:多图
            img_list:'img-list',//存放选择图片之后的容器
            input_name:'logo',//上传图片表单ID
            img_num:6,//多图上传的总数
            num:2
        });
    });

    $('#select-img2').click(function(){
        uploader.open({
            elm:'select-img2',//选择图片上传的按钮
            url:"<?=url('common/AjaxController/uploader',['path'=>'site_config'])?>",//服务器url
            up_type:1,//上传图片类型1:单图,2:多图
            img_list:'img-list2',//存放选择图片之后的容器
            input_name:'qrcode',//上传图片表单ID
            img_num:6,//多图上传的总数
            num:2
        });
    });
</script>
{/block}